﻿using FellowshipOne.API.Events.Sets;

namespace FellowshipOne.API.Realms
{
    public class Events
    {
        #region Properties
        F1OAuthTicket _ticket { get; set; }
        string _baseUrl { get; set; }

        private AttendanceSummary _attendanceSummary;
        private Attendance _attendance;
        private AttendanceCollection _attendanceCollection;

        public AttendanceSummary AttendanceSummary
        {
            get
            {
                if (_attendanceSummary == null)
                {
                    _attendanceSummary = new AttendanceSummary(_ticket, _baseUrl);
                }
                return _attendanceSummary;
            }
        }

        public Attendance Attendance
        {
            get
            {
                if (_attendance == null)
                {
                    _attendance = new Attendance(_ticket, _baseUrl);
                }
                return _attendance;
            }
        }

        public AttendanceCollection AttendanceCollection
        {
            get
            {
                if (_attendanceCollection == null)
                {
                    _attendanceCollection = new AttendanceCollection(_ticket, _baseUrl);
                }
                return _attendanceCollection;
            }
        }

        #endregion
         #region Constructor
        public Events(F1OAuthTicket ticket, string baseUrl) {
            _ticket = ticket;
            _baseUrl = baseUrl;
        }
        #endregion Constructor
    }
}
